Talk:Mind flayer
Mind Flayer AI As this discussion has application in four articles, I want to post it here and give some time before making changes. First off, regarding just this creature: In combat, a mind flayer prefers spellcasting (by 30, for those who work with AI scripts) This information is used by the script (increasing nMagic by 30) but in practice has no effect, (nMagic is already 55 + HD + Random(10), all criteria for setting this value lower or decreasing it are not satisfied by the mindflayer creature, and nMagic is only checked for being greater than 50 or for being greater than 0). and is flagged to use a more randomized spell selection than other creatures might. This is only called in x0_i0_talent under the command GetCreatureTalent() (which is in only place nw_i0_generic ever accesses the command GetCreatureTalentBest()). GetCreatureTalent() can only be called in two different ways, one by which GetCreatureTalentRandom() is always used, and the other where GetCreatureTalentBest() is used by default, but is overridden to GetCreatureTalentRandom() in the presence of the variable on the mindflayer). As the talent category is never checked, this potentially randomizes more than just spells (as hard-coded feats can also belong), and ensures that nw_i0_generic never uses GetCreatureTalentBest(). However, mindflayer abilities are scattered throughout many of the talent categories (e.g. mass concussion is 1, the charm monster is 2, inertial barrier is 13, and the mindblasts are both 11) so the only spells that this randomizes amongst each other are the mind blasts. Now for the things that pertain to all four using the scripted AI. As this information seems to be spread across four articles without too many of them being synchronized I am blockquoting with the article that it came from identified at the beginning. Mind flayer: If in combat with a creature of a playable race who is neither petrified nor polymorphed, but is stunned or paralyzed, then the mind flayer will move to be 1.5 meters from that creature and use its extract brain ability. Daze is also considered as reflected in the alhoon article. Alhoon: If the target is dazed, an alhoon will perform an extract brain attack 9% of the time, a psionic mind blast that does not count against the daily limit 21% of the time, and use normal attacks the remaining 70% of the time. The 9% and 21% are a result of performing the check twice (likely the intended behavior was to check once and use extract brain 30% of the time and not use the psionic mind blast). Mind flayer: (If the target becomes polymorphed or loses the debilitating condition before the mind flayer is in position, it will use a psionic mind blast that does not count against the daily limit instead of extracting the brain.) This is not the case because the condition is carried out after the action is queued but before it takes place. As there is no delay command used here the second check is done at the same time as the first. Mind flayer: There are a few quirks (bugs) associated with this. First, a creature of the Tiefling subrace (case sensitive) is considered a playable race and is considered stunned/paralyzed. (This was probably an attempt to account for Valen Shadowbreath in the Hordes of the Underdark campaign, but not intended to bypass the stunned/paralyzed check.) Second, a creature subject to a spell failure effect (not from equipment) is considered stunned/paralyzed by mind flayers. (Instead of spell failure, the intent was to detect the visual effect associated with being paralyzed, but this was incorrectly implemented.) For the Tiefling subrace the mindflayer is scheduled to perform the psionic mind blast which does not consume uses (unless the tiefling is already afflicted by one of the extract brain conditions, in which case it will use extract brain (or if dazed 70% psionic mind blast 30% extract brain). The rest is correct, and should cover all the obvious bases. There are non-obvious ones (like the mind flayer ignores creatures scheduled to bash at a door for its special AI attack). WhiZard 00:34, November 28, 2011 (UTC) * If someone is working with AI scripts, then your assumptions about the cutoffs for nMagic are invalid, as those depend on the AI scripts not being changed by someone working on them. On the other hand, the standard AI effectively ignoring this value would justify moving the info to notes (and that info probably should have been in the notes to start with since standard mind flayers are not spellcasters). Mind flayers are flagged to use a more randomized spell selection than others. Whether or not this has an effect on gameplay does not change the existence of this flag. This probably should have been a note for builders customizing the standard creature, though, since the default creature has no spells. Your information about the flag affecting spell-like abilities does not change this, given the spread of spell-like abilities you observed. I object to "without too many of them being synchronized" as only one of the articles (alhoon) is not synchronized; the text in the mind flayer darkener and ulithiard articles was copied from the mind flayer one and the only changes made were to the creature names. (The mind flayer article does have an extra sentence leading off the paragraph, but I made sure to have that be a separate line in the article source.) Neglecting to synch up the alhoon article hardly warrants the implication that there was no attempt at synchronization. I forget why this article (hence also the ones that copied it) does not mention being dazed. I vaguely recall observing that one logical branch could not be followed, but I am not seeing it now. Yes, the likely intent was to use extract brain 30% of the time with one of the other choices the other 70%, but I do not see a reason to think the psionic mind blast was not intended. Rather, it looks to me like the intent changed (different coders or done on different days), but the script was not fully changed to reflect the new intent, and no clue left behind to indicate which was coded first. I do seem to have messed up on reading the timing of the checks. Thanks for catching that. Are the extra details for Tieflings really worth the extra confusion the explanation can cause? The point is to warn builders (and players) of the bug regarding that subrace. The major point of the bug is that Tieflings are treated as disabled; the exact ability used as a consequence is of lesser importance. What is this "non-obvious" case regarding ignoring creatures scheduled to bash a door? All I see is the mind flayer not using its special AI if the mind flayer (not the intruder) is scheduled to bash a door. --The Krit 04:42, November 28, 2011 (UTC) :* Looks good, most of the fine points I found and you didn't include I would not have included either in the article. Putting the mindflayer spells down to the notes was what I had in mind (though I had thought that you had meant TALENT_TYPE_SPELL when referring to randomized spellcasting (referring to spellcasting without spells didn't make sense), which is why I went through the spell-like abilities). I agree I was probably too unfair by stating too many articles being out of synchronization, I had seen no resemblance between two of the articles, and thought a third was also off in its own way, but looking back, I guess I was mistaken about the third. For tiefling, I would only have mentioned that the special AI would be overly aggressive with psionic mind blasts against it (likely a bug), rather than noting it to be considered disabled (apart from the daze percentages, the only difference the tiefling brings in is that when the special AI would not be applied for a non-tiefling, the tiefling instead suffers the mind blasts); however, your wording also fits the circumstance. For the bash doors, I should have thoroughly read the function code rather than quickly glancing at the commented description. I had no intention of including it, which is what I meant by non-obvious. WhiZard 07:21, November 28, 2011 (UTC) ::* Actually, I was probably not referring to anything with "randomized spellcasting". ;) The variable was set, so it got noted. I was doing all the non-undead mind flayer articles at the time (alhoon had been done earlier) and probably did not notice that the one with the flag set was not one of the spellcasters. --The Krit 13:49, November 28, 2011 (UTC)